
import staticType from './staticType'

export const getTimeInterval = (beginTime,endTime,timeType)=>{
  let days = 0;
  if(timeType ==staticType.timeBaseOnEnum.multiYear){
    days =Math.ceil((endTime - beginTime)/(365*12*24*60*60*1000))
  }else if(timeType ==staticType.timeBaseOnEnum.year){
    days = Math.ceil((endTime - beginTime)/(31*24*60*60*1000))
  }else if(timeType ==staticType.timeBaseOnEnum.month){
    days = Math.ceil((endTime - beginTime)/(24*60*60*1000))
  }else{
    days = Math.ceil((endTime - beginTime)/(60*60*1000))
  }
  return days
};
export default getTimeInterval
